package com.wench.design.pattern.flyweight;

/**
 * 享元模式在Integer类中的应用
 *
 * @author WenchGuo
 * @date 2021/11/26 11:31
 */
public class FlyweightDemo {

    public static void main(String[] args) {
        Integer valueOne = 127;
        Integer valueTwo = 127;

        System.out.println("valueOne和valueTwo对象是否是同一个对象？" + (valueOne == (valueTwo)));

        Integer valueThree = 128;
        Integer valueFour = 128;

        System.out.println("valueThree和valueFour对象是否是同一个对象？" + (valueThree == (valueFour)));
    }
}
